package com.mashiguang.po;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="sys_resource")
public class Resource {

	@Id
	private Integer id;
	
	@Column(name="resource_name")
	private String resourceName;
	
	@Column(name="resource_url")
	private String resourceUrl;
	
	@OneToMany
	@JoinTable(name="authorities_resource",
			joinColumns=@JoinColumn(name="resource_id"),
			inverseJoinColumns=@JoinColumn(name="authorities_id"))
	private List<Authority> authorities;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getResourceName() {
		return resourceName;
	}
	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}
	public String getResourceUrl() {
		return resourceUrl;
	}
	public void setResourceUrl(String resourceUrl) {
		this.resourceUrl = resourceUrl;
	}
	public List<Authority> getAuthorities() {
		return authorities;
	}
	public void setAuthorities(List<Authority> authorities) {
		this.authorities = authorities;
	}
	
}
